<page-header model="ctrl.navModel"></page-header>

<div class="page-container page-body" ng-cloak>

	<h2 class="page-sub-heading">邀请用户</h2>

	<div class="p-b-2">
    发送邀请或将现有的 ATOPS 用户添加到组织
		<span class="highlight-word">{{contextSrv.user.orgName}}</span>
	</div>

	<form name="ctrl.inviteForm">
		<div class="gf-form-group">
			<div class="gf-form max-width-30">
				<span class="gf-form-label width-10">Email 或用户名</span>
				<input type="text" ng-model="ctrl.invite.loginOrEmail" required class="gf-form-input" placeholder="email@test.com">
			</div>
			<div class="gf-form max-width-30">
				<span class="gf-form-label width-10">姓名</span>
				<input type="text" ng-model="ctrl.invite.name" class="gf-form-input" placeholder="姓名（可选的）">
			</div>
			<div class="gf-form max-width-30">
        <span class="gf-form-label width-10">角色</span>
				<select ng-model="ctrl.invite.role" class="gf-form-input" 
				ng-options="k as v for (k,v) in {'Viewer':'观众', 'Editor':'编辑', 'Admin':'管理员'}">
				</select>
			</div>

			<gf-form-switch class="gf-form" label="发送邀请邮件" checked="ctrl.invite.sendEmail" label-class="width-10"></gf-form-switch>

			<div class="gf-form-button-row">
				<button type="submit" class="btn btn-success" ng-click="ctrl.sendInvite();">邀请</button>
				<a class="btn btn-inverse" href="org/users">返回</a>
			</div>
	</form>
</div>
